<?php
	namespace Admin\Model;

	class AdminUserModel extends \Think\Model
	{	
		// 遍历获取后台登录用户表信息
		public function getAll()
		{
			//这里获取所有的数据
			$userlist=$this->select();
			
			foreach ($userlist as $key => $value) 
			{	
				$userlist[$key]['sex']=$value['sex']?'男':'女';
			}
			// var_dump($userlist);
			
		}
		//查询条件的拼接
		public function getFind($data)
		{
			//处理data
			foreach ($data as $key => $value) {
			 	$where.="`$key`='$value' AND ";
			}
			 $where=trim($where,' AND ');
			  //find只查询一条
			 $res=$this->where($where)->find();
			 if (!is_null($res)) {
			 	return $res;
			 }else{
			 	return false;
			 }
		}
	}